package IHM;
import java.awt.Color;
import java.awt.GridLayout;

import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.Border;

/**
 * 
 * @author LocoRocoBattleStein
 *
 */
public class CaractTour extends JPanel {

	/**
	 * 
	 */
	private JLabel cost;
	private JLabel life;
	private JLabel velocity;
	private JLabel range;
	private JLabel rate;
	
	private static final long serialVersionUID = 1L;

	/**
	 * constructor de CaractTour
	 */
	public CaractTour(){
		
		super(new GridLayout(2,3));
		this.setBackground( Color.white);		
		
		this.cost = new JLabel();
		this.cost.setText(" cost: ");
		this.add(this.cost);
		
		this.life = new JLabel();
		this.life.setText(" life: ");
		this.add(this.life);
		
		this.velocity = new JLabel();
		this.velocity.setText(" velocity: ");
		this.add(this.velocity);
		
		this.range = new JLabel();
		this.range.setText(" range: ");
		this.add(this.range);
		
		this.rate = new JLabel();
		this.rate.setText(" rate: ");
		this.add(this.rate);
		
		Border border = BorderFactory.createLineBorder(Color.black, 1);
		this.setBorder(border);

		
		
	}
	
	/**
	 * mise a jour du panel contenant
	 * les caracteristiques des tours du menu
	 * @param idTour
	 */
	 public void updateInfoTourID(int idTour){
		
		
		switch(idTour){
		
		case 1:
			
		this.cost.setText(" COST : 250");
		
		this.velocity.setText(" EFFECT VELOCITY : no effect");
		
		this.life.setText(" EFFECT LIFE : -1");
		
		this.range.setText(" RANGE : 50");
		
		this.rate.setText(" RATE : 1000");
		
	 break;
			
		case 2:
			this.cost.setText(" COST : 250");
			
			this.velocity.setText(" EFFECT VELOCITY : no effect");
			
			this.life.setText(" EFFECT LIFE : -1");
			
			this.range.setText(" RANGE : 50");
			
			this.rate.setText(" RATE : 1000");
			
		  
					break;

		
		case 3:
			
			this.cost.setText(" COST : 250");
			
			this.velocity.setText(" EFFECT VELOCITY : -1");
			
			this.life.setText(" EFFECT LIFE : no effect");
			
			this.range.setText(" RANGE : 50");
			
			this.rate.setText(" RATE : 1000");
			
		  
					break;

		
		case 4:
					
			this.cost.setText(" COST : 250");
			
			this.velocity.setText(" EFFECT VELOCITY : no effect");
			
			this.life.setText(" EFFECT LIFE : -1");
			
			this.range.setText(" RANGE : 50");
			
			this.rate.setText(" RATE : 1000");
			
		  
					break;

		
		case 5:
					
			this.cost.setText(" COST : 250");
			
			this.velocity.setText(" EFFECT VELOCITY : no effect");
			
			this.life.setText(" EFFECT LIFE : +1");
			
			this.range.setText(" RANGE : 50");
			
			this.rate.setText(" RATE : 1000");
			
		  
					break;
					
		case 10:
			
			this.cost.setEnabled(false);
			
			this.velocity.setEnabled(false);
			
			this.life.setEnabled(false);
			
			this.range.setEnabled(false);
			
			this.rate.setEnabled(false);
			
					break;

		
		default :
			
		this.cost.setText(" COST : ");
		
		this.velocity.setText(" EFFECT VELOCITY : ");
		
		this.life.setText(" EFFECT LIFE : ");
		
		this.range.setText(" RANGE : ");
		
		this.rate.setText(" RATE : ");
		
	  
				break;
		}
	 }
			
}

